from building import *

cwd = GetCurrentDir()
CPPPATH = [cwd]

src = []

if GetDepend('SUPPORT_LVGL_EX'):
    CPPPATH.append(cwd + '/components/multilingual')  
    
    CPPPATH.append(cwd + '/widgets/lv_obj_ex')
    src += Glob('widgets/lv_obj_ex/lv_obj_ex.c')
    
    CPPPATH.append(cwd + '/widgets/lv_obj_matrix')
    src += Glob('widgets/lv_obj_matrix/lv_obj_matrix.c')
    if GetDepend('SUPPORT_LVGL_EX_DEMO'):
        src += Glob('widgets/lv_obj_matrix/lv_obj_matrix_demo.c') 
        
    CPPPATH.append(cwd + '/widgets/dtable')
    src += Glob('widgets/dtable/lv_dtable.c')
    if GetDepend('SUPPORT_LVGL_EX_DEMO'):
        src += Glob('widgets/dtable/lv_dtable_demo.c')   
                  
    CPPPATH.append(cwd + '/widgets/toolbar')
    src += Glob('widgets/toolbar/lv_toolbar.c')
    if GetDepend('SUPPORT_LVGL_EX_DEMO'):
        src += Glob('widgets/toolbar/lv_toolbar_demo.c')

    CPPPATH.append(cwd + '/widgets/ledstrip')
    src += Glob('widgets/ledstrip/lv_ledstrip.c')
    if GetDepend('SUPPORT_LVGL_EX_DEMO'):
        src += Glob('widgets/ledstrip/lv_ledstrip_demo.c')
        
    CPPPATH.append(cwd + '/widgets/battery')
    src += Glob('widgets/battery/lv_battery.c')
    if GetDepend('SUPPORT_LVGL_EX_DEMO'):
        src += Glob('widgets/battery/lv_battery_demo.c')        
        
    CPPPATH.append(cwd + '/module/appicon')
    src += Glob('module/appicon/lv_appicon.c')
    CPPPATH.append(cwd + '/module/appmenu')    
    if GetDepend('SUPPORT_LVGL_EX_DEMO'):
        src += Glob('module/appmenu/lv_appmenu_demo.c')

    src += Glob('instance/icon_state_wifi/icon_state_wifi.c')    

#增加SUPPORT_EX_PREINCLUDE定义以预包含Preinclude.h
predefine = ['LVGL_EX']
group = DefineGroup('LVGL_EX', src, depend = [''], CPPPATH=CPPPATH, CPPDEFINES = predefine)
Return('group')
